# Autor: Samuel Santos
# Data: 18/05/2012
# Source: http://stthiaggo.blogspot.com
# email: thiagsamuel@gmail.com

import pygame, sys
from pygame.locals import*

pygame.init()

width = 400
heigth = 300

white = (255,255,255)
black = (0,0,0)

#set setting screen
screen = pygame.display.set_mode((width, heigth),0,32)
pygame.display.set_caption("Blocks")

#criando uma lista de blocos
blocks = []

block1 = pygame.draw.rect(screen, white,(50, 100, 50, 10))
block2 = pygame.draw.rect(screen, white,(50, 150, 50, 10))
block3 = pygame.draw.rect(screen, white, (50, 200, 50, 10))
block4 = pygame.draw.rect(screen, white,(50, 250, 50, 10))

blocks.append(block1)
blocks.append(block2)
blocks.append(block3)
blocks.append(block4)

def move(blk):
	for i in range(len(blk)):
		blk[i].right += 1

#time
clock = pygame.time.Clock()

while True:
	
	screen.fill(black)
	
	for event in pygame.event.get():
		if event.type == QUIT:
			exit()
			
	for i in range(len(blocks)):
		pygame.draw.rect(screen,white, blocks[i])
	
	move(blocks)

	clock.tick(10)
	
	pygame.display.flip()
	



